package com.aaa.ssm.entity;

import com.aaa.ssm.entity.GradeDTO;
import lombok.Data;

import javax.validation.constraints.*;
import java.io.Serializable;
@Data
public class StudentDTO implements Serializable {
    private int id;
    @NotNull(message = "名字不能为空")
    @Size(min = 1, max = 3, message = "字数必须1到3个字")
    @Pattern(regexp = "^[\\u4e00-\\u9fa5]{1,3}$", message = "名字必须是中文")
    private String name;

    @NotNull(message = "年龄不能为空")
    @Min(value = 1, message = "年龄最小是1")
    @Max(value = 100, message = "年龄最大为100")
    private Integer age;

    @NotNull(message = "地址不能为空")
    @Pattern(regexp = "^[\\u4e00-\\u9fa5]+$", message = "地址必须是中文")
    private String address;

    @NotNull(message = "班级不能为空")
    private Integer gid;
    private String headImg;
    private GradeDTO gradeDTO;
}
